package com.wxs.common.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.wxs.common.pojo.RoleGroup;


/**
 * 角色组管理
 * 
 * @author zhucw
 *
 */
@Mapper
public interface RoleGroupMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(RoleGroup record);

	int insertSelective(RoleGroup record);

	RoleGroup selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(RoleGroup record);

	int updateByPrimaryKey(RoleGroup record);

	List<RoleGroup> list(@Param("name") String name, @Param("enabled") Boolean enabled);

	/**
	 * 删除关联表中权限
	 * 
	 * @param id
	 */
	@Delete("delete from rolegroup_role where roleGroupEntities_id=#{id}")
	int deleteRolegroup_Role(@Param("id") Integer id);
	
	public int saveRolegroup_Role(@Param("roleids") String[] roleids, @Param("role_group_id") Integer role_group_id);
}